Open
Conversation
|
코드 작성은 다른 PR을 보시고 코드 참고해주시면 될 것 같아요. |
dh2906
reviewed
Sep 30, 2025
Comment on lines
+8
to
+12
| Scanner sc = new Scanner(System.in); | ||
| //1.자동차 이름 입력하기 | ||
| System.out.println("경주할 자동차 이름을 입력하세요.(이름은 쉽표(,) 기준으로 구분합니다.)"); | ||
| String input = sc.nextLine(); | ||
| String[] carNames = input.split(","); |
Comment on lines
+19
to
+21
| if (attempts <= 0) { | ||
|
|
||
| } |
There was a problem hiding this comment.
이런 경우일때는 throw new IllegalArgumentException("시도 횟수에 음수가 들어올 수 없습니다."); 와 같이 작성해주시면 될 것 같아요.
| } | ||
| //3.경주 실행 | ||
| System.out.println("실행 결과"); | ||
| for (int i = 0; i < attempts; ++) { |
There was a problem hiding this comment.
증감식 부분에 ++ 연산자만 들어와있어요!
Suggested change
| for (int i = 0; i < attempts; ++) { | |
| for (int i = 0; i < attempts; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
제가 아직 아는게 없어서 자바 수업 때 배운거랑 강의자료 참고해서 틀은 잡아봤는데 세부 코드는 아직 채우지 못했습니다..